<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script>

        var url = decodeURIComponent(location.href.match(/url=([^#&]+)/)[1]);
        var state = location.href.match(/state=([^#&]+)/);
        var target = url + '&code=' +(Math.random()+'').slice(2)+ (state != null ? ('&state=' + state[1]) : '');
        console.log(target);
        location.href = target;


    </script>
    <style>


        div {
            display: inline-block;
            padding: 20px;
            margin: 20px;
            border-radius: 4px;

            box-shadow: 0 20px 20px 0 rgba(0, 0, 0, 0.1);
        }

    </style>
</head>
<body>
模拟微信授权页面
<div>
    iahiguhsdg
</div>
</body>
</html>